
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="Language" content="English">
	
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/default.min.css">
	<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/go.min.js"></script>
	<script>hljs.highlightAll();</script>
	
</head>

<body class="odilon">

<h1 style="display:none;"></h1>

<h2>About Odilon</h2>
<p><a href="https://odilon.io" target="_blank"> Odilon</a> is an Open Source Object Storage that runs on standard hardware.</p>
<p>It was designed as a redundant and secure file storage for applications that need to manage medium to large size objects (like pdfs, photos, audio, video).</p>
<p>It is small and easy to integrate, offers encryption, data protection and fault tolerance (software RAID and Erasure Codes) and detection of silent data degradation. 
Odilon also supports version control and master - standby replication over the Internet.</p>

<p>Odilon keeps objects encrypted (<i>Encryption at Rest</i>) using modern algorithms such as AES-256. 
Each object has a unique encryption key. In turn, the encryption key of the object can be generated by Odilon or, which is recommended for greater security, by a Key Management Server (KMS)
</p>

<p>Article on <b><a href="https://odilon.io/architecture.html" target="_blank">Odilon Architecture</a></b></p>

<h2>Odilon Java SDK</h2>
<p>
Odilon Java SDK is a client to perform bucket and object operations to a Odilon server. 
The Interface <a href="{@docRoot}/io/odilon/client/OdilonClient.html">OdilonClient</a> contains the API to interact with the Server. The Implemention class is <a href="{@docRoot}/io/odilon/client/ODClient.html">ODClient</a>.</p>

<h3>Minimum Requirements</h3>
Java 11 or above is required to use this SDK.
<br/>
This SDK will connect to an Odilon Server v1.13 or above. 

<h3>JAR download</h3>
The latest JAR can be downloaded from <a href="https://odilon.io#download" target="_blank">https://odilon.io#download</a>
<br/>

<h3>Maven usage</h3>
<div class="code" style="margin:0;">
From Maven Central
<pre>
<code class="language-xml">
	 &lt;dependency&gt;
		 &lt;groupId&gt;io.odilon&lt;/groupId&gt;
		 &lt;artifactId&gt;odilon-client&lt;/artifactId&gt;
		 &lt;version&gt;1.14&lt;/version&gt;
	 &lt;/dependency&gt;
</code>
</pre>
</div>
<h3>Quick Start Example - File Uploader</h3>
<p>This example program connects to an Odilon Server, makes a bucket on the server and then uploads a file to the bucket. <br/>
You need these items in order to connect to an Odilon server.</p>
<ul>
<li><b>Endpoint</b>. URL to target Odilon server (example: "http://localhost")</li>
<li><b>Port</b>. port of the target Odilon server (default is 9234)</li>
<li><b>Access key</b>. username of the target Odilon server (default is "odilon")</li>
<li><b>Secret Key</b>. Secret key (password) of the target Odilon server (default is "odilon")</li> 
</ul>
<div class="code" style="margin:0;">
<pre>
<code class="language-java">
/* these are the default values for the Server */
String endpoint = "http://localhost";
int port = 9234;
String accessKey = "odilon";
String secretKey = "odilon";
						
/** OdilonClient is the interface, ODClient is the implementation */
OdilonClient client = new ODClient(endpoint, port, accessKey, secretKey);

/** ping checks the status of server, it returns the String "ok" when the server is normal */
String ping = client.ping();
if (!ping.equals("ok")) {
	System.out.println("ping error -> " + ping);
	System.exit(1);
}

String bucketName = "bucket-demo";
	
try {
    /** check if the bucket exists, if not create it */
    if (client.existsBucket(bucketName))
        System.out.println("bucket already exists ->" + bucketName );
    else 
        client.createBucket(bucketName);
} catch (ODClientException e) {
        System.out.println(String.valueOf(e.getHttpStatus())+ " " + e.getMessage()+" " + String.valueOf(e.getErrorCode()));
		System.exit(1);
}

File file = new File("test.pdf");
String objectName = file.getName();

try (InputStream inputStream = new BufferedInputStream(new FileInputStream(file))) {	
	client.putObjectStream(bucketName, objectName, inputStream, Optional.of(file.getName()), Optional.empty());
} catch (ODClientException e) {
	System.out.println(String.valueOf(e.getHttpStatus())+" " + e.getMessage()+" " + String.valueOf(e.getErrorCode()));
	System.exit(1);
} catch (FileNotFoundException | IOException e1) {
	System.out.println(e1.getClass().getName() + " " + e1.getMessage());
	System.exit(1);
}
</code>
</pre>
</div>
<br/>

<h2>Odilon Server</h2>
<ul>
<li><a href="https://odilon.io" target="_blank">Download Odilon Server</a></li>
<li><a href="https://odilon.io/configuration.html" target="_blank">How to install and configure Odilon Server</a></li>
<li><a href="https://odilon.io/architecture.html" target="_blank">Odilon Architecture</a></li>
<li><a href="https://twitter.com/OdilonSoftware" target="_blank">Twitter for Odilon news: #OdilonSoftware</a></li>
</ul>

<h2>Java development</h2>
<ul>
<li><a href="https://odilon.io/development.html" target="_blank">https://odilon.io/development.html</a>Sample programs</li>
<li><a href="https://github.com/atolomei/odilon-server">Odilon Server - GitHub</a></li>
<li><a href="https://github.com/atolomei/odilon-client">Odilon Java SDK - GitHub</a>
</ul>

<h2>Videos</h2>
<ul>
<li><a href="https://youtu.be/irR_Eeq3I-I?si=74nZnUh4mxNW3F7R" target="_blank">Odilon installer for Windows - YouTube video (2 min)</a></li>
<li><a href="https://youtu.be/s2ZZibpOAg0" target="_blank">Odilon how to enable encryption - YouTube video (1 min)</a></li>
<li><a href="https://youtu.be/kI6jG9vZAjI?si=3KSOpbvN-6ThJf1m" target="_blank">Odilon demo - YouTube video (4 min)</a></li>

<!--li>StackOverflow: <a href="https://stackoverflow.com" target="_blank">https://stackoverflow.com</a></li -->
</ul>
</body>
</html>















